import threading
g_number = 0
def funcA():
    global g_number
    g_number += 1000
    print(f"子线程中的g_number值为{g_number}")

if __name__ == '__main__':
    thd = threading.Thread(target=funcA)
    print(g_number)
    thd.start()
    print(f"主线程中的g_number值为{g_number}")